from classes import track


def get_template(track: track.FlacTrack):
    template = f""

    genres = track.getGenre("/")
    subgenres = [
        subgenre for subgenre in track.getSubgenre("/") if not subgenre in genres
    ]

    releasedate = track.getReleaseDate()

    for element in track.getAlbumArtist():
        template += f"#{element.replace(' ', '_')}, "
    template = template[:-2]

    template += f" — {track.title}\n"

    template += "\nGenre: "
    for element in genres:
        template += f"#{element.replace(' ', '').replace('-', '').replace('&', 'and').replace('’', '')}, "
    template = template[:-2]

    template += "\nStyle: "
    for element in subgenres:
        template += f"#{element.replace(' ', '').replace('-', '').replace('&', 'and').replace('’', '')}, "
    template = template[:-2]

    template += f"\nreleased {releasedate.strftime('%B')} {releasedate.strftime('%d')}, {releasedate.strftime('%Y')}"

    return template
